*********************************************************************
* Filename: bs_z_2002_correction.do
* Data: ag_pwp.dta
* Author: Michael Tiernay
* Purpose: Replicate Box-Steffensmeier and Zorn (2002)
* The variable that stratifies the hazard rate in the cox model 
* appears to be incorrect.  Re-estimating the model with the correct
* stratification alters the results
*********************************************************************
clear
set more off

* Load in data from:
* Box-Steffensmeier and Zorn (2002)
* "Duration Models for Repeated Events"*use "ag_pwp.dta", clearuse "/Users/tiernay/Desktop/correction/ag_pwp.dta"*********************************************************************
*Replicate Column 5 From Tabel 2stset stop, fail(dispute) exit(futime) enter(start)stcox democ growth allies contig capratio trade, nohr robust cluster(dyadid) efron strata(sumdisp)********************************************************************** Show that failure never occurs when there has been no previous 
* dispute.  That is, the way the data is set up, there are never any
* failures with zero previous failures.
tab sumdisp disputelist dispute sumdisp if _n < 30********************************************************************** Generate a new identified for number of previous disputesgen newsumdisp = sumdisp-1 if dispute==1replace newsumdisp = sumdisp if newsumdisp==.tab newsumdisp disputelist dispute sumdisp newsumdisp if _n < 30* Re-run the analysis with the new stratificationstcox democ growth allies contig capratio trade, nohr robust cluster(dyadid) efron strata(newsumdisp)/* 

What are the differences with the new results?

Democracy is now negative and statistically significant

Compatability ratio is now negative and statistically significant

Trade is now negative (but remains statistically insignificant)

*/